<?php

namespace common\models;

use Yii;


/**
 * This is the model class for table "insurance_policy".
 *
 * @property string $id
 * @property string $policy_id
 * @property string $account_type
 * @property string $account_id
 * @property string $provider_id
 * @property string $plan_code
 * @property string $issue_date
 * @property string $effect_date
 * @property string $expire_date
 * @property integer $insured_amount
 * @property string $premium_currency
 * @property string $premium_total
 * @property string $status
 * @property string $create_time
 * @property string $pay_time
 * @property string $cancel_time
 * @property string $project_name
 * @property integer $is_bill
 * @property string $price_day
 * @property integer $number
 * @property string $destination
 * @property string $desc
 */
class InsurancePolicy extends \yii\db\ActiveRecord
{
    
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'insurance_policy';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_funfind');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['issue_date', 'effect_date', 'expire_date', 'create_time', 'pay_time', 'cancel_time'], 'safe'],
            [['insured_amount', 'is_bill', 'number'], 'integer'],
            [['premium_total'], 'required'],
            [['premium_total'], 'number'],
            [['policy_id'], 'string', 'max' => 50],
            [['account_type', 'provider_id', 'status'], 'string', 'max' => 16],
            [['account_id', 'price_day', 'destination'], 'string', 'max' => 32],
            [['plan_code', 'project_name'], 'string', 'max' => 64],
            [['premium_currency'], 'string', 'max' => 3],
            [['desc'], 'string', 'max' => 512],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '系统编号',
            'policy_id' => '安联订单号',
            'account_type' => '账户类型',
            'account_id' => '账户标识',
            'provider_id' => '服务提供商',
            'plan_code' => '保单标识',
            'issue_date' => '生效时间',
            'effect_date' => '有效时间',
            'expire_date' => '过期时间',
            'insured_amount' => '保额',
            'premium_currency' => '币种',
            'premium_total' => '总额',
            'status' => '状态',
            'create_time' => '生成时间',
            'pay_time' => '支付时间',
            'cancel_time' => '取消时间',
            'project_name' => '项目名称',
            'is_bill' => '是否需要账单',
            'price_day' => '天数',
            'number' => '数量',
            'destination' => '旅行目的地',
            'desc' => '描述',
        ];
    }
}
